import React, { useState } from "react"
const Demo: FC = () => {
  const [count, setCount] = useState(0)
  function add() {
    setCount(count + 1)
  }
  function alertFn() {
    setTimeout(() => {
      alert(count)
    }, 3000)
  }
  return <>
    <p>闭包陷阱</p>
    <div>
        <span>{count}</span>
    </div>
  </>
}
export default Demo
